home *** CD-ROM | disk | FTP | other *** search
- /*
- * FILE: menu.h
- * AUTHOR: R. Gonzalez
- * CREATED: August 25, 1990
- *
- * Defines menu class for Generic_App.
- */
-
- # ifndef menu_h
- # define menu_h
-
- # include "class.h"
- # include "app.h"
-
- # define MAX_MENUS 20
- # define MAX_ITEMS 20
- # define ILLEGAL -1
-
- /* pointer to function used to implement a command: */
- typedef boolean (*comfunc)(Generic_App*);
-
- /************************************************************************
- * menu
- ************************************************************************/
- struct Menu:Generic_Class
- {
- int num_menus;
- int num_items[MAX_MENUS+1];
- char *command[MAX_MENUS+1][MAX_ITEMS+1];
- comfunc command_ptr[MAX_MENUS+1][MAX_ITEMS+1];
-
- boolean init(void);
- virtual boolean log_command(int,int,char*,comfunc);
- virtual int get_menu(char*);
- virtual int get_item(char*);
- virtual comfunc get_command_ptr(int,int);
- };
-
- # endif
-